﻿@model List<MovieMadness.Model.Movie>
<h2>Reviews</h2>

@foreach (var m in Model)
{
    <div class="well">
        @Html.LabelFor(x => m.Title): @m.Title <br /> @Html.ActionLink("Add Review", "AddReview", new { id = m.MovieId }, new { @class = "btn btn-default" })
        <br /> 
        <table class="table table-bordered">
            <tbody>
                @foreach (var r in m.Reviews)
                {
                    <tr>
                        @*<td>@r.ReviewId</td>*@
                        <td><i>Post:</i> @r.Post</td>
                    </tr>
                    <tr>
                        <td><i>Date Posted:</i> @r.DatePosted</td>
                    </tr>
                    <tr>
                        <td><i>Rating:</i>@r.Rating</td>
                    </tr>
                    <tr>
                        <td>
                            @Html.ActionLink(" Edit ", "EditReview", new { id = r.ReviewId })
                        @Html.ActionLink(" Delete ", "DeleteReview", new { id = r.ReviewId })
                    </td>
                </tr>
                }
            </tbody>
        </table>
    </div>
}